package main

import (
	log "github.com/corgi-kx/logcustom"
	httpTransport "github.com/go-kit/kit/transport/http"
	MyMux"github.com/gorilla/mux"
	"go-micro-kit/EndPoints"
	"go-micro-kit/Services"
	"go-micro-kit/transport"
	"net/http"
)

func main()  {
	// 创建服务
	userService:=Services.UserService{}
	userEndPoint:=EndPoints.LoginEndPoint(userService)
	server := httpTransport.NewServer(userEndPoint, transport.DecodeUserRequest, transport.EncodeUserResponse)
	log.Info("go-kit服务已经启动................")
	// 使用第三方Mux路由
	r:=MyMux.NewRouter()
	r.Methods("GET").Path("/user").Handler(server)
	// 使用go自带的http
	_ = http.ListenAndServe(":8080", r)





}